import React from 'react'
import {useSelector,useDispatch} from 'react-redux'
import {addActionCreator} from '../store/actions/counterAction'
export default function Left(props) {

  const count=useSelector((state)=>{
    return state.count
  })
  const commit=useDispatch()
  return (
    <div style={{flex:1,height:'100vh',background:'springgreen'}}>
      <h1>{count}</h1>
      <button onClick={()=>{
        commit(addActionCreator(2))
      }}>+</button>
    </div>
  )
}

